@file:Suppress("unused")

package com.example.demo.model

import xyz.erupt.annotation.*
import xyz.erupt.annotation.sub_field.*
import xyz.erupt.annotation.sub_field.sub_edit.*
import xyz.erupt.jpa.model.*
import java.util.*
import javax.persistence.*

@Table(name = "demo_simple")
@Entity
@Erupt(name = "简单示例")
class Simple : BaseModel() {

    @EruptField(
        views = [View(title = "文本")],
        edit = Edit(title = "文本", notNull = true, search = Search()),
    )
    var input: String = ""

    @EruptField(
        views = [View(title = "数值", sortable = true)],
        edit = Edit(title = "数值", search = Search()),
    )
    var number: Float? = null

    @EruptField(
        views = [View(title = "布尔")],
        edit = Edit(title = "布尔"),
    )
    var bool: Boolean? = null

    @EruptField(
        views = [View(title = "时间")],
        edit = Edit(title = "时间", search = Search(vague = true)),
    )
    var date: Date? = null

    @EruptField(
        views = [View(title = "滑动条")],
        edit = Edit(
            title = "滑动条",
            type = EditType.SLIDER,
            search = Search(),
            sliderType = SliderType(max = 100, markPoints = [30, 60]),
        ),
    )
    var slide: Int? = null

}